/*****************************************************************************/
/**
 *  @file   StaggeredSPHFileListToAVSField.cpp
 *  @author Naohisa Sakamoto
 */
/*----------------------------------------------------------------------------
 *
 *  Copyright (c) Visualization Laboratory, Kyoto University.
 *  All rights reserved.
 *  See http://www.viz.media.kyoto-u.ac.jp/kvs/copyright/ for details.
 *
 *  $Id$
 */
/*****************************************************************************/
#include "StaggeredSPHFileListToAVSField.h"
#include "SPHFile.h"
#include "ImportStaggeredSPHFileList.h"
#include <kvs/StructuredVolumeObject>
#include <kvs/StructuredVolumeExporter>


namespace kvsbloodvis
{

namespace util
{

/*===========================================================================*/
/**
 *  @brief  Returns AVS field data from staggered
 *  @param  sph [in] SPH file
 *  @return AVS field data
 */
/*===========================================================================*/
kvs::AVSField StaggeredSPHFileListToAVSField( const SPHFileList& sph_list )
{
    kvs::StructuredVolumeObject volume = ImportStaggeredSPHFileList( sph_list );
    kvs::StructuredVolumeExporter<kvs::AVSField> exporter( &volume );
    kvs::AVSField avs = exporter;
    return avs;
}

} // end of namespace util

} // end of namespace kvsbloodvis
